package cn.blnp.net.flowable.listen.task.listener;

import lombok.extern.slf4j.Slf4j;
import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * <h3></h3>
 *
 * @author <a href="mailto:blnp.yibin@qq.com">lyb</a>
 * @version 1.0
 * @since 2025/5/21 14:17
 */
@Slf4j
@Component("myTaskListenerBean")
public class MyTaskListenerBean implements Serializable {

    public void printInfo(DelegateTask task) {
        //获取任务节点定义key
        String taskDefinitionKey = task.getTaskDefinitionKey();
        //获取事件名称
        String eventName = task.getEventName();
        log.info("（{}）通过expression指定的监听器：用户任务{}的{}事件触发", task.getEventName(), taskDefinitionKey, eventName);
    }
}
